
u9ImHd.registerModule('GiveStock', [])

    .config(['$stateProvider', function ($stateProvider) {
        $stateProvider
            .state('GiveStock', {
                url: '/GiveStock',
                templateUrl: u9ImHd.getFullPath('tpls/home.html', 'GiveStock'),
                controller: 'GiveStock.HomeCtrl',
                resolve: {
                    'loading': ['$q', '$state', '$timeout', 'imanDialog', '$stateParams',
                        function($q, $state, $timeout, imanDialog,$stateParams) {
                        var defer = $q.defer();
                        
                        
                        $timeout(function () {
                            var wareHouse = angular.fromJson(window.localStorage.getItem("wareHouse"));
                            //没有仓库数据，跳转到仓库页面
                            if(wareHouse===null){
                                
                                $state.go('House');    
                            } 
                            defer.resolve();
                        }); 
                        
                        return defer.promise;       
                    }]
                }
            })
            .state('House', {
                url: '/House',
                templateUrl: u9ImHd.getFullPath('tpls/house.html', 'GiveStock'),
                controller: 'GiveStock.HouseCtrl'
            });
            
    }]);